//
//
//  Generated by StarUML(tm) C++ Add-In
//
//  @ Project : OOAD5T
//  @ File Name : EventBus.cpp
//  @ Date : 2026-05-03
//  @ Author : 
//
//


#include "EventBus.h"

void EventBus::publishStartCleaning() {
    for (auto& cb : startCleaningSubs) cb();
}

void EventBus::subScribeStartCleaning(startCleaningCallBack cb) {
    startCleaningSubs.push_back(cb);
}

void EventBus::publishAvoidObstacle(SensorProvider* sender) {
    for (auto& cb : avoidObstacleSubs) cb(sender);
}

void EventBus::subScribeAvoidObstacle(avoidObstacleCallBack cb) {
    avoidObstacleSubs.push_back(cb);
}

void EventBus::publishDetectedDust() {
    for (auto& cb : detectedDustSubs) cb();
}

void EventBus::subScribeDetectedDust(detectDustCallBack cb) {
    detectedDustSubs.push_back(cb);
}

void EventBus::publishTurnOff()
{
    for (auto& cb : turnOffSubs) cb();
}

void EventBus::subScribeTurnOff(turnOffCallBack cb)
{
    turnOffSubs.push_back(cb);
}
